const mongoose = require('mongoose')
var userSchema = new mongoose.Schema({
    studentNumber: {//学号 |登录账号
        type: Number,
        unique: true,
        required: true,
        trim: true,
    },
    name: {  //姓名
        type: String,
        required: true,
        trim: true
    },
    password: {//登录密码
        type: String,
        required: true,
        trim: true,
        //select: false
    },
    period: {//第几届
        type: String,
        trim: true,
        default: "待完善"
    },
    class: {//班级
        type: String,
        trim: true,
        default: "待完善"
    },
    professional: {//专业
        type: String,
        trim: true,
        default: "待完善"
    },
    identity: { //职位
        type: String,
        default: '普通学生',
        enum: ["普通学生", "班长", "团委"]
    },
    credit: {//学分
        type: Number,
        default: 0
    },
    head: {
        type: String,
        default: ''
    }
})
var user = mongoose.model("users", userSchema);
module.exports = user